<template>
	<nav-bar :title="$t('關於我哋')" leftIcon="left"></nav-bar>
	<view class="content" style="color:#fff;">
		{{$t('FlowArk係領先嘅Web3流量服務商，基於雲端計算構建嘅集群流量服務系統，運用服務器終端與外部網絡通信，以網絡配置和安全策略實現對流量網絡功效嘅提升和深度優化。')}}
		{{$t('FlowArk致力於喺通信網絡、IT、智能終端同雲服務領域為客戶提供有競爭力、安全可信賴嘅產品、解決方案與服務，擁有豐富嘅全球化運營能力和全球化網絡優勢及全球化合作伙伴。 加速Web3演進，共同構建去中心化嘅全新網絡傳輸體系。')}} 
	</view>
</template>

<script setup>
	import HInput from '@/components/h-input.vue'
	import {
		jump
	} from '@/utils/common.js'
	import loginRequest from '@/hooks/login.js'
	import i18n from '@/locale/index'
	const {
		getVerificationCode,
		userRegister
	} = loginRequest()
	import {
		ref,
		watch 
	} from "vue";
	let isGetCode = ref(true) //是否已经获取验证码
	let email = ref('') //邮箱
	let authCode = ref('') //验证码
	let passWord = ref('') //密码
	let inviteCode = ref('') //邀请码
	let countDownNum = ref(0) //倒计时数字
	let isShow = ref('text')
	watch(email, (now, old) => {
	})
	const jumpLogin = () =>{
		uni.navigateTo({
			url: "/pages/login/login",
			animationType: "fade-in",
			animationDuration: 200,
		});
	}
	const onClick = async () => {
		if (!email.value || !passWord.value || !inviteCode.value) {
			return uni.showToast({
				title: `${i18n.global.t('請完善信息！')}`,
				icon: 'none',
			})
		}
		await userRegister('user/registerUserInfo', {
			mailbox: email.value,
			password: passWord.value,
			code: inviteCode.value
		})
		uni.showToast({
			title: `${i18n.global.t('注冊成功！')}`,
			icon: 'none',
		})
		uni.redirectTo({
			url: '/pages/login/login'
		})

	}

	const changeEmail = (val) => {
		email.value = val
	}
	const changeAuthCode = (val) => {
		authCode.value = val
	}
	const changePassWord = (val) => {
		passWord.value = val
	}
	const changeInviteCode = (val) => {
		inviteCode.value = val
	}
	// 获取验证码 
	const getAuthCode = async () => {
		if (!email.value) {
			return uni.showToast({
				title: `${i18n.global.t('請填寫郵箱')}`,
				icon: 'none',
			})
		}
		isGetCode.value = false
		countDownNum.value = 60
		let timer = setInterval(() => {
			countDownNum.value--
			if (countDownNum.value === 0) {
				clearInterval(timer)
				isGetCode.value = true
			}
		}, 1000)
		const res = await getVerificationCode('user/sendVerificationCode', email.value)
	}

	//修改input密码状态
	function cutType(val) {
		isShow.value = val
	}
</script>

<style lang="scss" scoped>
	.codeText {
		width: 170rpx;
		height: 27rpx;
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #636897;
		line-height: 27rpx;
		text-align: center;
		border-left: 1rpx solid #636897;
	}

	.content {
		margin: 0 55rpx;
	}

	.inpIcon {
		width: 30rpx;
		height: 22rpx;
	}

	.top-title {
		width: 100%;
		margin-top: 150rpx;

		.imgIcon {
			width: 121rpx;
			height: 79rpx;
		}

		.welcome {
			font-size: 42rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			line-height: 42rpx;
			margin-top: 27rpx;
		}

		.text {
			font-size: 24rpx;
			margin-top: 21rpx;
			font-family: PingFang SC;
			font-weight: 300;
			line-height: 24rpx;
			background: linear-gradient(to right, #7B65FF 0%, #FF78A8 50%);
			-webkit-background-clip: text;
			-webkit-text-fill-color: transparent;
		}
	}

	.from {
		width: 100%;
		padding-top: 38rpx;
	}

	.goLogin {
		width: 100%;
		text-align: right;
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 24rpx;
		margin: 30rpx 0;
	}

	.btn-sub {
		width: 640rpx;
		height: 90rpx;
		background: linear-gradient(90deg, #5641DD, #B1A6FD);
		border-radius: 45rpx;
		text-align: center;
		line-height: 90rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
	}
</style>